﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="admin_Mail_Default" %>
<%@ MasterType VirtualPath="~/admin/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server">
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>用户请求
            </h1>
            <ol class="breadcrumb">
                <li><a href="Me.aspx"><i class="fa fa-dashboard"></i>用户请求</a></li>
            </ol>
        </section>
        
        <!-- Main content -->
        <section class="content">

            <div class="row">
                
                <!-- /.col -->
                <div class="col-md-12">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">用户请求</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body no-padding">
                            <asp:GridView ID="GridView1" runat="server" PageSize="20" AutoGenerateColumns="False" AllowPaging="True" CssClass="table table-striped" GridLines="None" OnPageIndexChanging="GridView1_PageIndexChanging" EmptyDataText="暂无数据">
                                <Columns>
                                    <asp:TemplateField HeaderText="擅长的领域" HeaderStyle-CssClass="mailbox-name">
                                        <ItemTemplate>
                                            <%# Eval("skills") %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="申请理由" HeaderStyle-CssClass="mailbox-name">
                                        <ItemTemplate>
                                            <%# Eval("contents") %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="申请用户" HeaderStyle-CssClass="mailbox-name">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="HyperLink0" NavigateUrl=<%# "~/admin/User/Show.aspx?id="+Eval("user_id") %> runat="server"><%# Eval("name") %></asp:HyperLink>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="操作" HeaderStyle-CssClass="mailbox-date">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="HyperLink1" onclick=<%# "openDialog(" + Eval("id") + ")" %> runat="server" CssClass="cursor">删除</asp:HyperLink>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <PagerTemplate>
                                    <div class="mailbox-controls">
                                        <div class="pull-right">
                                            <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
                                            <div class="btn-group">
                                                <asp:LinkButton ID="lbnFirst" runat="Server" CssClass="btn btn-default" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First"></asp:LinkButton>
                                                <asp:LinkButton ID="lbnPrev" runat="server" CssClass="btn btn-default" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
                                                <asp:LinkButton ID="lbnNext" runat="Server" CssClass="btn btn-default" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next"></asp:LinkButton>
                                                <asp:LinkButton ID="lbnLast" runat="Server" CssClass="btn btn-default" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last"></asp:LinkButton>
                                            </div>
                                        </div>
                                    </div>
                                </PagerTemplate>
                            </asp:GridView>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.nav-tabs-custom -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
            <div id="delModal" class="modal fade" role="dialog" aria-labelledby="delTitle" aria-hidden="true">
                <div class="modal-dialog modal-sm">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                            <h4 class="modal-title" id="delTitle">确认删除吗？</h4>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-primary" onclick="confirm()">确认</button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" Runat="Server">
    <script>
        var del_id;
        function openDialog(id) {
            del_id = id;
            $('#delModal').modal('show');
        }
        function confirm() {
            if (del_id != null) {
                location.href = "/admin/Mail/Default.aspx?del_id=" + del_id + "";
            }
        }
    </script>
</asp:Content>

